1. Field of the Invention
The present invention relates to a magnetic field generating device which generates a magnetic field acting on a portable device, and a method for calculating an offset of a triaxial magnetic sensor built in the portable device.
2. Description of the Related Art
As portable devices such as a cell phone and a tablet-type PC, those having the triaxial magnetic sensor built therein are known. The portable device detects a geomagnetic vector using the triaxial magnetic sensor and calculates the azimuth in which the portable device is directed using the detected value, and is configured to display the azimuth on its display part and to display map information in accordance with the direction thereof.
Many electronic components are mounted, in addition to the triaxial magnetic sensor, in the portable device. Therefore, the electronic components generate a magnetic field (internal magnetic field) within the portable device so that the detected values of the geomagnetic vector by the triaxial magnetic sensor are sometimes inaccurate. When the detected values of the triaxial magnetic sensor are inaccurate, the azimuth in which the portable device is directed cannot be accurately calculated. In order to solve this disadvantage, a method for correcting detection errors of the triaxial magnetic sensor caused by the internal magnetic field of the portable device has been developed.
In order to correct the detection errors, the following method, for example, is employed.
Upon change in posture of the portable device, the detected value of the geomagnetic vector by the triaxial magnetic sensor changes. As shown in FIG. 13, this detected value P would draw a sphere (hereinafter referred to as “azimuth sphere”) within the triaxial orthogonal coordinate system (X, Y, Z) of the triaxial magnetic sensor along with the change in posture of the portable device. In the presence of the influences of the internal magnetic field, a center point O′ of an azimuth sphere 9 does not coincide with an original point O of the triaxial orthogonal coordinate system. When the coordinates of the center point O′ of the azimuth sphere 9 are calculated, the detected value (OP vector) of the triaxial magnetic sensor can be corrected by the following mathematical formula using a deviation (OO′ vector) between the original point O of the triaxial orthogonal coordinate system and the center point O′ of the azimuth sphere, thereby making it possible to obtain an accurate geomagnetic vector (O′P) which is not affected by the internal magnetic field and to calculate an accurate azimuth of the portable device.[Mathematical Formula 1]{right arrow over (O′P)}={right arrow over (OP)}−{right arrow over (OO′)}  (Formula 1)
For precise calculation of the center point O′ of the azimuth sphere 9, namely, offset, it is necessary to conduct an operation of changing the direction of the portable device to the geomagnetism (hereinafter referred to also as “calibrating operation”) to acquire detected values within a wide range on the azimuth sphere. However, such an operation is a burden on users, and thus, for example, attempts have been made to utilize a change in direction which naturally occurs when users use the portable device (for example, users take out the portable device from a pocket, or turn and walk in another direction) and to select detected values which are as far from each other as possible on the azimuth sphere from the obtained detected values to obtain the center point of the azimuth sphere (see JP 2008-241675 A and JP 2012-168140 A).    Patent Document 1: JP 2008-241675    Patent Document 2: JP 2012-168140